<?php 
	echo $form->create('Asession', array('action'=>'answer'));
	echo $form->hidden('token',  array( 'value' => $token));
?>

<?php

	$the_question = str_replace("\n",'<br />',$question['Question']['question']);

?>

<p><?php echo $the_question ;?></p>

<?php 

	echo $form->hidden('Question.question_id',  array( 'value' => $question['Question']['id']));

	//print "<pre>";print_r($question);print "</pre>";exit;

	switch ($question['Answertype']['Formtype']['name']) {
		case 'checkbox':
		    echo $this->element('question_checkbox');
		    break;
		case 'radio':
		    echo $this->element('question_radio');
		    break;
		case 'text':
		    echo $this->element('question_text');
		    break;
		case 'textarea':
		    echo $this->element('question_textarea');
		    break;
		case 'select':
		    echo $this->element('question_select');
		    break;
		case 'order':
		    echo $this->element('question_order');
		    break;
		case 'image':
		    echo $this->element('question_images');
		    break;
	}

?>
<br />
<br />
<?php echo $form->end('Submit Answer'); ?>
